Linked repositories
Insights Factory System has multiple integration points. Out of the box it’s shipped with integration to Meniga Digital Banking as a datasource and contains multiple repositories related to it.
Methods fetching data, defined in repositories, are provided to Bank Administrator while creating/updating insight definitions. They are also used by Triggering Engine to make proper evaluations of audience/triggering conditions and rendering message's content. For more information on repositories and their implementation, see Repositories section.
Transactions repository
Provides access to transaction history of a single user. User context is established in Triggering Engine when processing each incoming event.
Method signature | Return type | Description |
---|---|---|
Count(TransactionsFilter filter) | int | Returns number of transactions filling filter criteria. |
SumAbsAmounts(TransactionsFilter filter) | decimal | Returns sum of amount absolute values of filtered transaction. |
AvgAbsAmounts(TransactionsFilter filter) | decimal | Returns average of amount absolute values of filtered transaction. |
CoefficientVariationAbsAmounts(TransactionsFilter filter) | decimal | Returns coefficient of variation of amount absolute values of filtered transaction |
AvgSumAmountMonthly(TransactionsFilter filter) | decimal | Returns average of absolute values of amounts summed monthly. |
MinSumAmountMonthly(TransactionsFilter filter) | decimal | Returns minimum of absolute values of amounts summed monthly. |
MaxSumAmountMonthly(TransactionsFilter filter) | decimal | Returns maximum of the absolute values of amounts summed monthly. |
GetHistoryStart(TransactionsFilter filter) | DateTime | Returns date of the oldest of filtered transactions. |
MinCountMonthly(TransactionsFilter filter) | int | Returns minimum of the count of transactions grouped monthly. |
MaxCountMonthly(TransactionsFilter filter) | int | Returns maximum of the count of transactions grouped monthly. |
GetTopSpendingCategories(TransactionsFilter filter, int count) | List<Category> | Returns a (count length) list of categories where the highest amount was spent. |
Used types:
Transactions Filter
public class TransactionsFilter
{
public DateTime? DateFrom { get; }
public DateTime? DateTo { get; }
public bool? IsExpense { get; }
public int[]? Categories { get; }
}
Property | Description |
---|---|
DateFrom | Minimal date (inclusive) of the transaction date to filter transactions by. |
DateTo | Maximum date (inclusive) of the transaction date to filter transactions by. |
IsExpense | true if filtering for expenses is intended |
Categories | Collection of categories' identifiers to filter transactions by. |
Category
public record Category
{
public int Id { get; init; }
public string Name { get; init; }
public int? ParentId { get; init; }
public string? ParentName { get; init; }
public int Type { get; init; }
public int ContextId { get; init; }
public bool UserCreated { get; init; }
}
Property | Description |
---|---|
Id | Unique transactions category identifier. |
Name | Category name. |
ParentId | Identifier of category group. |
ParentName | Name of category group. |
Type | Category type. |
ContextId | Identifier of the category context. |
UserCreated | Determines if category was created by a user. |
Category repository
Provides information about categories.
Method signature | Return type | Description |
---|---|---|
GetCategories(int[] ids) | List<Category> | Returns a list of categories with given ids. |
GetParentCategory(long categoryId) | int? | Returns identifier of the parent category of category with categoryId. |
GetCategoryType(long categoryId) | int? | Returns category type identifier of category with categoryId. |
GetCategoryContext(long categoryId) | int? | Returns category context identifier of category with categoryId. |
DateTime calculations repository
Provides possibility to make calculations on DateTime.
Method signature | Return type | Description |
---|---|---|
AddInterval(DateTime dt, DateTimeInterval interval) | DateTime | Returns calculated datetime. For example AddInterval(DateTime.Today, new {1, IntervalType.Day}) would return tomorrow's date. |
Used types:
DateTimeInterval
public class DateTimeInterval
{
public IntervalType Type { get; init; }
public int Quantity { get; init; }
}
Property | Description |
---|---|
Type | Type of interval. Possible values are:'Day', 'Week', 'Month', 'Year' |
Quantity | Number of intervals of given type |
User repository
Allows to fetch User data. For person connected functions if user has multiple persons only first person's data is returned.
Method signature | Return type | Description |
---|---|---|
UserCreated() | DateTime | Returns user's creation date. |
UserIsInitialSetupDone() | bool | Returns information whether user's initial setup is completed. |
UserPostalCode() | string? | Returns user's postal code. |
UserMaritalStatus() | int? | Returns user's martial status. |
UserNumberInFamily() | int? | Returns number of people living in user's household. |
UserNumberOfKids() | int? | Returns number of user's children. |
UserNumberOfCars() | int? | Returns number of cars in user's household. |
UserIncome() | int? | Returns user's income class. Household income classification from low to high. |
UserApartmentType() | int? | Returns user's apartment type. |
UserApartmentSize() | int? | Returns user's apartment size. |
UserApartmentRooms() | int? | Returns number of rooms in user's apartment. |
UserCategoryContext() | int? | Returns category tree source context id. |
UserCurrencyCode() | string | Returns user's currency code. |
PersonEmail() | string | Returns email of the person assigned to the user. |
PersonCreated() | DateTime | Returns creation date of the person assigned to the user. |
PersonLastLoginDate() | DateTime? | Returns date of the last login of person assigned to the user. |
PersonCulture() | string | Returns culture of the person assigned to the user. |
PersonDateOfBirth() | DateTime? | Returns date of birth of the person assigned to the user. |
PersonGender() | int? | Returns gender person assigned to the user. |
PersonEmailConfirmed() | bool | Returns information if person's assigned to the user email is confirmed. |
PersonIsPersonalSetupDone() | bool | Returns information if person's assigned to the user personal setup is completed. |
PersonPasswordResetExpiration() | DateTime? | Returns password's reset expiration date of the person assigned to the user. |
PersonTermsConditionsAcceptDate() | DateTime? | Returns terms of conditions acceptance date done by the person assigned to the user. |
PersonOptOutDate() | DateTime? | Returns optout date done by the person assigned to the user. |
PersonPhoneNumber() | string | Returns phone number of the person assigned to the user. |
PersonFirstName() | string | Returns firstName of the person assigned to the user. |
PersonLastName() | string | Returns lastName of the person assigned to the user. |
PersonPasswordExpiryDate() | DateTime? | Returns password's expiration date of the person assigned to the user. |
PersonPasswordSetDate() | DateTime? | Returns password's set date of the person assigned to the user. |